package com.android.corestat.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

import com.android.corestat.service.WorkingService;
import com.android.corestat.utils.CSLog;

public class BootReceiver extends BroadcastReceiver {
	@Override
	public void onReceive(Context context, Intent intent) {
		if (intent != null) {
			if (Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction())) {
				if (!WorkingService.isServiceTaskFinished(context)) {
					if (!WorkingService.isServiceRunning(context)) {
						
						CSLog.e("CoreState", "BootReceiver startWorkingService");
						WorkingService.startWorkingService(context, 0);
					}
				}
			}
		}
	}
}
